import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    isLoggedIn: false,
    username: '',
    avatar: ''
  }),
  
  actions: {
    async login(credentials: { username: string; password: string }) {
      // TODO: 实现登录逻辑
      this.isLoggedIn = true
      this.username = credentials.username
      this.avatar = '' // 设置默认头像
    },
    
    async logout() {
      this.isLoggedIn = false
      this.username = ''
      this.avatar = ''
    }
  }
}) 